home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / MPW / Examples / PPCExamples / CPlusExamples / CPlusTESample / TESample.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-12-03  |  2.3 KB  |  80 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Simple TextEdit Sample Application
  6. #
  7. #    CPlusTESample
  8. #
  9. #    TESample.h    -    C++ source
  10. #
  11. #    Copyright © 1989 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. #    Versions:    
  15. #            1.10                     07/89
  16. #            1.00                     04/89
  17. #
  18. #    Components:
  19. #            CPlusTESample.make        July 9, 1989
  20. #            TApplicationCommon.h    July 9, 1989
  21. #            TApplication.h            July 9, 1989
  22. #            TDocument.h                July 9, 1989
  23. #            TECommon.h                July 9, 1989
  24. #            TESample.h                July 9, 1989
  25. #            TEDocument.h            July 9, 1989
  26. #            TDocument.cp            July 9, 1989
  27. #            TESample.cp                July 9, 1989
  28. #            TESampleGlue.a            July 9, 1989
  29. #            TApplication.r            July 9, 1989
  30. #
  31. #    CPlusTESample is an example application that demonstrates
  32. #    how to initialize the commonly used toolbox managers,
  33. #    operate successfully under MultiFinder, handle desk
  34. #    accessories and create, grow, and zoom windows. The
  35. #    fundamental TextEdit toolbox calls and TextEdit autoscroll
  36. #    are demonstrated. It also shows how to create and maintain
  37. #    scrollbar controls. 
  38. #
  39. #    This version of TESample has been substantially reworked in
  40. #    C++ to show how a "typical" object oriented program could
  41. #    be written. To this end, what was once a single source code
  42. #    file has been restructured into a set of classes which
  43. #    demonstrate the advantages of object-oriented programming.
  44. #
  45. ------------------------------------------------------------------------------*/
  46.  
  47. #ifndef TESample_Defs
  48. #define TESample_Defs
  49.  
  50. // we need resource definitions
  51. #include "TECommon.h"
  52.  
  53. // Since we are based on the Application class, we need its class definitions
  54. #include "TApplication.h"
  55.  
  56. // TESample is our application class. It is a subclass of TApplication,
  57. // so it only needs to specify its behaviour in areas where it is different
  58. // from the default.
  59.     class TESample : public TApplication
  60.     {
  61.         public:
  62.             TESample( void );                        // Our constructor
  63.         
  64.         private:
  65.             // routines from TApplication we are overriding
  66.                 long HeapNeeded( void );
  67.                 unsigned long SleepVal( void );
  68.                 void DoIdle( void );
  69.                 void AdjustCursor( void );
  70.                 void AdjustMenus( void );
  71.                 void DoMenuCommand( short menuID, short menuItem );
  72.         
  73.             // routines for our own devious purposes
  74.                 void DoNew( void );
  75.                 void Terminate( void );
  76.                 
  77.     }; /* class TESample */
  78.  
  79. #endif // TESample_Defs
  80.